package weak_20241227_29.stream;

import java.util.ArrayList;

/**
 * @author zdl
 * @date 2024/12/27
 */
public class Demo10 {
    public static void main(String[] args) {
        //10. 检查整数列表中是否存在至少一个数字大于10
        ArrayList<Integer> list = new ArrayList<>();
        list.add(2);
        list.add(-9);
        list.add(9);
        list.add(-20);
        list.add(1);
       /* boolean b = list.stream().anyMatch(new Predicate<Integer>() {
            @Override
            public boolean test(Integer integer) {
                return integer > 10;
            }
        });*/
        boolean b = list.stream().anyMatch(i -> i > 10);
        System.out.println(b);
    }
}
